home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / yxvals.h < prev   
Encoding:
Text File  |  1994-07-18  |  1.7 KB  |  74 lines  |  [TEXT/MMCC]

  1. // yxvals.h values header for C++
  2. #ifndef _YXVALS_
  3. #define _YXVALS_
  4. #ifndef _YVALS
  5.  #include <yvals.h>
  6. #endif
  7.  
  8. #if __MWERKS__
  9. #pragma options align=mac68k
  10. #endif
  11.  
  12.         // typeinfo description type
  13. typedef int _Typedesc;
  14.         // type bool
  15. #if _HAS_BOOL_TYPE
  16.  typedef bool _Bool;
  17. #else
  18.  typedef int _Bool;
  19. #endif    /* _HAS_BOOL_TYPE */
  20.         // exception macros
  21. #if _HAS_EXCEPTIONS
  22.  #define _TRY_BEGIN    try {
  23.  #define _CATCH_ALL    } catch (...) {
  24.  #define _CATCH_END    }
  25.  #define _RAISE(x)    throw (x)
  26.  #define _RERAISE    throw
  27. #elif _MICROSOFT_EXCEPTIONS
  28.  #define _TRY_BEGIN    TRY
  29.  #define _CATCH_ALL    CATCH(CException, _PCEx)
  30.  #define _CATCH_END    END_CATCH
  31.  #define _RAISE(x)    THROW(&(x))
  32.  #define _RERAISE    THROW_LAST()
  33. #else    /* no exceptions */
  34.  #define _TRY_BEGIN    {{
  35.  #define _CATCH_ALL    } if (0) {
  36.  #define _CATCH_END    }}
  37.  #define _RAISE(x)    xmsg::_Throw(&(x))
  38.  #define _RERAISE    xmsg::_Throw(0)
  39. #endif
  40.         // bitmask macros
  41. #if _HAS_ENUM_OVERLOADING
  42.  #define _BITMASK(E, T)    \
  43. E& operator&=(E& _X, E _Y) \
  44.     {_X = (E)(_X & _Y); return (_X); } \
  45. E& operator|=(E& _X, E _Y) \
  46.     {_X = (E)(_X | _Y); return (_X); } \
  47. E& operator^=(E& _X, E _Y) \
  48.     {_X = (E)(_X ^ _Y); return (_X); } \
  49. E& operator&(E _X, E _Y) \
  50.     {return ((E)(_X & _Y)); } \
  51. E& operator|(E _X, E _Y) \
  52.     {return ((E)(_X | _Y)); } \
  53. E& operator^(E _X, E _Y) \
  54.     {return ((E)(_X ^ _Y)); } \
  55. E& operator~(E _X) \
  56.     {return ((E)~_X); } \
  57. typedef E T
  58. #else
  59.  #define _BITMASK(E, T)    typedef int T
  60. #endif    /* _HAS_ENUM_OVERLOADING */
  61. #define _HAS_PJP_CLIB    1    /* for filebuf/FILE coordination */
  62.  
  63. #if __MWERKS__
  64. #pragma options align=reset
  65. #endif
  66.  
  67. #endif /* _YXVALS_ */
  68.  
  69. /*
  70.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  71.  * Consult your license regarding permissions and restrictions.
  72.  */
  73.  
  74.